import { ref } from "vue"
// dict
import { useDict } from "@/dict/index"
export function useSearchForm(){
    const { useDictList } = useDict()
    /**
     * 搜索项配置
     */
    const searchFormJSON = ref([
        {
            label: "借阅状态",
            field: "status",
            control: 'select',
            options: useDictList('borrowlStatusOptions')
        },
        {
            label: "书籍名称",
            field: "book_name",
            control: 'input'
        },
        {
            label: "ISBN",
            field: "book_isbn",
            control: 'input'
        },
        {
            label: "借阅者姓名",
            field: "user_name",
            control: 'input'
        },
        {
            label: "借阅日期",
            field: "create_date",
            control: "daterange",
            valueFormat: "YYYY-MM-DD"
        },
        {
            label: "应还日期",
            field: "due_date",
            control: 'daterange',
        },
        {
            label: "归还日期",
            field: "return_date",
            control: 'daterange',
        },
    ])

    return {
        searchFormJSON
    }
}

